toList

abstract fun toList(): List<Any>

Converts this array to a List.

The type mapping rules for the array elements are the following:


| JavaScript         | Java           |
|--------------------|----------------|
| Number             | Double         |
| String             | String         |
| Boolean            | Boolean        |
| null and undefined | null           |
| Node               | Node, JsObject |
| ArrayBuffer        | byte[]         |
| Array              | List<?>        |
| Set                | Set<?>         |
| Map                | Map<?,?>       |
| Object             | JsObject       |
| Proxy Object       | Object         |

Proxy objects are mapped to the corresponding injected Java object.

Return

an unmodifiable list containing the converted array elements

Throws

when the JavaScript object is already disposed or invalid


abstract fun <T> toList(type: Class<T>): List<T>

Converts this array to a List with the elements of the specified type.

The type mapping rules for the array elements are the following:


| JavaScript         | Java           |
|--------------------|----------------|
| Number             | Double         |
| String             | String         |
| Boolean            | Boolean        |
| null and undefined | null           |
| Node               | Node, JsObject |
| ArrayBuffer        | byte[]         |
| Array              | List<?>        |
| Set                | Set<?>         |
| Map                | Map<?,?>       |
| Object             | JsObject       |
| Proxy Object       | Object         |

Proxy objects are mapped to the corresponding injected Java object.

All elements in the array must be of a type convertible to the type T according to the mapping rules.

Return

an unmodifiable list containing the converted array elements

Parameters

type

the Java type to convert elements in this array to, according to the mapping rules

<T>

the type of the converted elements

Throws

if the elements in this array cannot be converted to the specified type

when the JavaScript object is already disposed or invalid